package com.lb.activity.service;

import com.lb.activity.po.Permission;
import com.lb.activity.po.Role;
import com.lb.activity.util.PermissionTree;
import com.lb.activity.util.ResultUtil;

import java.util.List;

/**
 * @author liubin
 */
public interface PermissionService {

    /**
     * 查询权限
     * @return
     */
    List<Permission> AllMeuns();

    /**
     * 添加 or update
     * @param permission
     * @return
     */
    ResultUtil add(Permission permission);

    Permission  getOne(Long id);

    ResultUtil delete(Long id);

    ResultUtil changeStatus(Long id, boolean boolStatus);

    /**
     * 查询name 是否已经上传过
     * @param name
     * @param id
     * @return
     */
    ResultUtil getOneByName(String name, Long id);

    PermissionTree<Permission> getTree(Long roleId);

    void updateRoleAndmenuIds(Long id, List<String> menus);

    /**
     * 权限菜单
     * @param id
     * @return
     */
    List<PermissionTree<Permission>> listMenuTree(Long id);

    Permission getPermission(Long permissionid);
}
